﻿@page
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@model GroupMeal.Web.Pages.Foods.FoodTypeModel
@inject IPageLayout PageLayout
@{
    PageLayout.Content.Title = "菜品类型";
}
<div class="content-container">
    <div id="app">
        <el-row>
            <el-col :span="24">
                <div class="grid-content bg-purple-dark">
                    <el-input v-model.trim="filterName" placeholder="类型名称" size="mini" style="width:300px;" clearable></el-input>
                    <el-button type="primary" v-on:click="loadTableData" icon="el-icon-search" style="margin-left:10px;" size="mini">搜索</el-button>
                    <el-button type="primary" v-on:click="showCreate" icon="el-icon-plus" size="mini">新建</el-button>
                </div>
            </el-col>
        </el-row>
        <hr class="line-gray" />
        <el-row>
            <el-table :data="tableData" size="mini" style="width:100%" current-row-key="id">
                <el-table-column type="index" width="50" label="编号">

                </el-table-column>
                <el-table-column label="名称" property="name">

                </el-table-column>
                <el-table-column label="操作">
                    <template slot-scope="scope">
                        <el-button size="mini" icon="el-icon-edit" v-on:click="showEdit(scope.$index, scope.row)"></el-button>
                        <el-button size="mini" icon="el-icon-delete" type="danger" v-on:click="deleteFoodType(scope.$index, scope.row)"></el-button>
                    </template>
                </el-table-column>
            </el-table>
        </el-row>
        <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" v-on:close="resetForm" :close-on-click-modal="false" fullscreen>
            <el-form :model="foodType" :label-width="formLabelWidth" ref="foodTypeForm" :rules="rules">
                <el-row>
                    <el-col :span="24">
                        <div class="grid-content bg-purple-dark">
                            <el-form-item label="名称" prop="name">
                                <el-input v-model.trim="textTemplate.name" size="mini" autocomplete="off" clearable></el-input>
                            </el-form-item>
                        </div>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="24">
                        <div class="grid-content bg-purple-dark">
                            <el-form-item label="描述">
                                <el-input v-model.trim="textTemplate.name" size="mini" autocomplete="off" clearable></el-input>
                            </el-form-item>
                        </div>
                    </el-col>
                </el-row>
            </el-form> 
            <div slot="footer" class="dialog-footer">
                <el-button type="primary" v-on:click="save" size="mini">保存</el-button>
            </div>
        </el-dialog>
    </div>
</div>